package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;

@Mapper
public interface UserMapper {
    @Select("select * from user where openid=#{openid}")
 public User selectUserByopenid(String openid);

    public void insert(User user);

    @Select("select *from user where id=#{id}")
    public User getById(Long id);
    @Select("select count(id) from user where create_time>#{start} and create_time<#{end}")
    public Integer userreport(LocalDateTime start, LocalDateTime end);

    @Select("select count(id) from user where  create_time<#{end}")
    public Integer usertotal( LocalDateTime end);
}
